#include "AspectEngine.h"

namespace agtk {
	
	Camera::Camera(void)
	{
		m_position = new Vec3<float>;
		m_focalPoint = new Vec3<float>;
		m_up = new Vec3<float>;
		// Log it.
		g_aspectEngine->GetLogger()->Log(LOGGER_INFO, "New camera created");

	}
	
	Camera::Camera(Vec3<float> position, Vec3<float> focalPoint, Vec3<float> up)
	{
		m_position = new Vec3<float>(position);
		m_focalPoint = new Vec3<float>(focalPoint);
		m_up = new Vec3<float>(up);
		// Log it.
		g_aspectEngine->GetLogger()->Log(LOGGER_INFO, "New camera created at", const_cast<char*>(m_position->GetStringFormat().c_str()));

	}
	
	Camera::~Camera(void)
	{
		SAFE_DELETE(m_position);
		SAFE_DELETE(m_focalPoint);
		SAFE_DELETE(m_up);
	}
	
	Vec3<float>* Camera::GetPosition(void)
	{
		return m_position;
	}
	
	Vec3<float>* Camera::GetFocalPoint(void)
	{
		return m_focalPoint;
	}
	
	Vec3<float>* Camera::GetUp(void)
	{
		return m_up;
	}
	
	// Incomplete
	void Camera::Pan(Vec2<float> direction)
	{
		// Calculate focus and up vectors as relative to position.
	}
}